<template>
  <div>
    <div>
      <el-form
        :inline="true"
        :model="formInline"
        class="demo-form-inline"
        ref="formInline"
      >
        <el-form-item label="企业名称" prop="region">
          <el-select v-model="formInline.region" placeholder="请选择企业">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button
            type="primary"
            size="mini"
            icon="el-icon-search"
            @click="onSubmit"
            >搜索</el-button
          >

          <el-button
            @click="resetForm('formInline')"
            icon="el-icon-refresh"
            size="mini"
            >重置</el-button
          >
        </el-form-item>
      </el-form>
    </div>
    <div>
      <el-button plain icon="el-icon-plus" size="mini" type="primary" @click="handleClick(scope)"
        >新增</el-button
      >
    </div>

    <div>
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column type="index" label="编号" width="180">
        </el-table-column>
        <el-table-column prop="companyName" label="企业名称"> </el-table-column>
        <el-table-column prop="companySimple_name" label="企业简称">
        </el-table-column>
        <el-table-column prop="personnelNumber" label="人员数量">
        </el-table-column>
        <el-table-column prop="signColor" label="编辑颜色"> </el-table-column>
        <el-table-column prop="position" label="地理位置"> </el-table-column>

        <el-table-column fixed="right" label="操作">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope)" type="text" size="small"
              >查看</el-button
            >
            <el-button type="text" size="small">编辑</el-button>
            <el-button type="text" size="small">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
            <!-- :current-page="currentPage4" -->
    <div class="block">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"

        :page-sizes="[100, 200, 300, 400]"
        :page-size="100"
        layout="total, sizes, prev, pager, next, jumper"
        :total="400"
      >
      </el-pagination>
    </div>
  </div>
</template>

<script>
// import { getInfo } from "@/api/info/index.js";

export default {
  name: "InforIndex",
  data() {
    return {
      formInline: {
        region: "",
        // currentPage4: 4,
      },
      tableData: [
        {
          companyName: "泡泡茶壶",
          companySimple_name: "坟墓",
          personnelNumber: "64",
          signColor: "红",
          position: "地下",
        },
      ],
    };
  },
  //   created() {
  //     //请求发送
  //     this.getList;
  //   },

  methods: {
    //请求列表
    // getList() {
    //   getInfo().then(() => {
    //     console.log(res,"res");
    //     date
    //   });
    // },
    onSubmit() {
      console.log("submit!");
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
    handleClick(scope) {
      console.log(scope);
      this.$router.push({
        name: "InforDetail"
      });
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
  },
};
</script>
  